package com.friend.common.event;

import lombok.Getter;
import lombok.Setter;
import org.springframework.context.ApplicationEvent;

/**
 * 题目变更事件
 * 用于触发ES索引自动同步
 */
@Getter
@Setter
public class QuestionChangeEvent extends ApplicationEvent {
    
    private Long questionId;
    private Operation operation;
    private Object source;
    
    public enum Operation {
        INSERT, UPDATE, DELETE
    }
    
    public QuestionChangeEvent(Object source, Long questionId, Operation operation) {
        super(source);
        this.source = source;
        this.questionId = questionId;
        this.operation = operation;
    }
}
